package com.weiyuwqj.api.constant;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by pg on 15/11/17.
 */
public class Constants {

    public static String SAFETY_CODE = "d55ae9e606ccaa9cfa";

    public static String platform_id = "1";

    public static final String reg_validatecode_sms = "reg_validatecode_sms";
    public static final String recharge_sms = "recharge_sms";
    public static final String withdrawals_sms = "withdrawals_sms";
    public static final String invest_sms = "invest_sms";
    public static final String repay_sms = "repay_sms";
    public static final String payment_sms = "payment_sms";
    public static final String modifyinvite_sms = "modifyinvite_sms";
    public static final String cash_sms = "cash_sms";
    public static final String other_equipment_login_sms = "other_equipment_login_sms";
    public static final String other_equipment_login_push = "other_equipment_login_sms";
    public static final String birthday_prompt_mail = "birthday_prompt_mail";
    public static final String birthday_sms = "birthday_sms";
    public static final String collect_prompt_mail = "collect_prompt_mail";
    public static final String recommend_register_prompt_mail = "recommend_register_prompt_mail";
    public static final String rechage_cash_prompt_mail = "rechage_cash_prompt_mail";
    public static final String customer_invest_prompt_mail = "customer_invest_prompt_mail";
    public static final String item_full_invest_sms = "item_full_invest_sms";
    public static final String item_full_loan_sms = "item_full_loan_sms";
    public static final String repay_loan_sms = "repay_loan_sms";


    public static final int days = 30; //30天

    //configTicket beigin
    public static final String invest_nid = "invest";
    public static final String first_invest_nid = "first_invest";
    public static final String first_invite_invest_nid = "first_invest_invite";
    //public static final String year_invest_nid ="year_invest";
    public static final String recharge_nid = "recharge";
    public static final String send_intime_nid = "send_intime";
    public static final String bid_nid = "bid";
    public static final String invite_nid = "invite";
    public static final String realname_invite_nid = "realname_invite";
    public static final String auto_invest_nid = "auto_invest";
    public static final String register_nid = "register";
    public static final String redeem_code_nid = "redeem_code";
    public static final String total_invest_nid = "total_invest";

    //configTicket end

    //短信模板标识
    public static final String VALIDATECODE = "_validatecode_";
    public static final String USERNAME = "_username_";
    public static final String AWARD = "_award_";
    public static final String AWARDTYPE = "_awardtype_";
    public static final String MONEY = "_money_";
    public static final String LOCKLIFE = "_locklife_";
    public static final String REALNAME = "_realname_";
    public static final String MOBILE = "_mobile_";
    public static final String DATETIME = "_datetime_";

    //短信验证码间隔时间
    public static final long VALIDATETIME = 300;


    //第三方登录类型
    public static final String weixin_login_type = "weixin";
    public static final String qq_login_type = "qq";
    public static final String weibo_login_type = "weibo";


    //通过投资获得的抽奖次数
    public static final String invest_get_lotteryNum = "INVEST_GET_LOTTERYNUM";

    public static final String login_get_lotteryNum = "LOGIN_GET_LOTTERYNUM";

    public static final String register_get_lotteryNum = "REGISTER_GET_LOTTERYNUM";

    public static final String first_login_get_lotteryNum = "FIRST_LOGIN_GET_LOTTERYNUM";

    public static final String sys_get_lotteryNum = "SYS_GET_LOTTERYNUM";


    //债权转让最低投资金额
    public static final BigDecimal DEBT_LOWEST_AMOUNT = new BigDecimal(100);

    /**
     * 支付平台号
     */
    public static final String PLAT_NO = "wqj-17005";

    //短信信息
    public static final String SMSTAIL = "【】";//短信签名尾巴
    //短信接口信息
    public static String TIANGE_SMS_UID = "";
    public static String TIANGE_SMS_PWD = "";
    //发送短信
    public static String SENDSMS_URL = "http://202.85.221.42:9885/c123/sendsms";
    //查询余额
    public static String QUERYMONEY_URL = "http://202.85.221.42:9885/c123/querymoney";
    public static final String UTF_8 = "UTF-8";


    /**
     * 实时付款签名方式.
     */
    public static final String SIGN_TYPE = "RSA";
    /**
     * 接口版本号，固定1.0
     */
    public static final String VERSION = "1.0";
    // 业务类型，连连支付根据商户业务为商户开设的业务类型； （101001：虚拟商品销售、109001：实物商品销售、108001：外部账户充值）
    public static final String BUSI_PARTNER = "101001";
    /**
     * 测试商户号私钥
     */
    public static final String BUSINESS_PRIVATE_KEY = "MN4tR7HpSax7oN+ma5WquncHGm6ElIuRv2jYbrWfCeWmBbsAZVoM57n01k7hyLWmDMYoKh8vnzKjrWScDkaQ6qGTbPVL3x0EBoxgb/smnT6/A5XyB9bvAkEA6UKhP1KLi/ImaLFUgLvEvmbUrpzY2I1+jgdsoj9Bm4a8K+KROsnNAIvRsKNgJPWd64uuQntUFPKkcyfBV1MXFQJBAJGs3Mf6xYVIEE75VgiTyx0x2VdoLvmDmqBzCVxBLCnvmuToOU8QlhJ4zFdhA1OWqOdzFQSw34rYjMRPN24wKuECQEqpYhVzpWkA9BxUjli6QUo0feT6HUqLV7O8WqBAIQ7X/IkLdzLa/vwqxM6GLLMHzylixz9OXGZsGAkn83GxDdUCQA9+pQOitY0WranUHeZFKWAHZszSjtbe6wDAdiKdXCfig0/rOdxAODCbQrQs7PYy1ed8DuVQlHPwRGtokVGHATU=";

    /**
     * 商户号-测试
     */
    public static final String OID_PARTNER_TEST = "20001543";

    /**
     * MD5 KEY
     */
    public static final String AUTH_MD5_KEY = "201408_20140812";

    /**
	 * 项目周期
	 */
	private static Map<Integer, Integer> itemUnit = new HashMap<Integer, Integer>();

	static {
		itemUnit.put(1, 1); // 天
		itemUnit.put(2, 7); // 周
		itemUnit.put(3, 30); // 月
		itemUnit.put(4, 90); // 季
		itemUnit.put(5, 360); // 年
	}

	/**
	 * 根据项目周期和单位获取天数
	 *
	 * @param itemCycle     周期
	 * @param itemCycleUnit 单位
	 * @return
	 */
	public static Integer getItemCycleToDate(int itemCycle, int itemCycleUnit) {
		return itemCycle * itemUnit.get(itemCycleUnit);
	}


}
